package com.atguigu.gmall.product.biz.impl;

import com.atguigu.gmall.product.biz.CategoryBizService;
import com.atguigu.gmall.product.entity.CategoryView;
import com.atguigu.gmall.product.mapper.BaseCategory1Mapper;
import com.atguigu.gmall.web.CategoryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author:ahang
 * @create:2022-10-03 20:49
 * @Description:
 */
@Service
public class CategoryBizServiceImpl implements CategoryBizService {

    @Autowired
    private BaseCategory1Mapper baseCategory1Mapper;

    /**
     * 获取分类属性结构
     * @return
     */
    @Override
    public List<CategoryVo> getCategoryTree() {

        List<CategoryVo> list = baseCategory1Mapper.getCategoryTree();
        return list;
    }


    /**
     * 查询三级分类值和名
     * @param skuId
     * @return
     */
    @Override
    public CategoryView getCategory(Long skuId) {
        CategoryView categoryView = baseCategory1Mapper.getCategory(skuId);
        return categoryView;
    }


}
